package com.itbaizhan.exception;

import com.itbaizhan.result.CodeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author spf
 * @date 2024/3/4
 * @time 9:24
 */
@Data
@AllArgsConstructor
public class BusException extends RuntimeException {

    // 状态码
    private Integer code;
    // 异常消息
    private String message;

    public BusException(CodeEnum codeEnum){
        this.code = codeEnum.getCode();
        this.message = codeEnum.getMessage();
    }

}
